package com.qf.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.qf.serializer.Number2GenderSerializer;

import java.util.Date;

/**
 * @author zjw
 * @description
 * @date 2021/10/8$ 16:18$
 */
public class UserVO {

    @JsonProperty(value = "username")
    private String name;

    @JsonIgnore
    private Integer age;

    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    @JsonInclude(value = JsonInclude.Include.NON_EMPTY)
    @JsonSerialize(using = Number2GenderSerializer.class)
    @JsonProperty(value = "sex")
    private Integer gender;

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    @Override
    public String toString() {
        return "UserVO{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", birthday=" + birthday +
                '}';
    }

    public UserVO(String name, Integer age, Date birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }

    public UserVO() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}
